package com.tbq.game.service.dao

import com.tbq.game.service.activity.login.UserModel
import com.tbq.game.service.app.V_HTTP
import com.tbq.game.service.http.Http
import com.tbq.game.service.http.OnHttpListener

object UserDao {
    /**
     * 版本更新
     */
    fun updateVersion(listener: OnHttpListener<String>) {
        val params = MainDao.insertInterfaceData(mutableMapOf())
        Http.get(V_HTTP.URL_UPDATE_VERSION, params, listener)
    }

    /**
     * 登录
     */
    fun login(username: String, password: String, listener: OnHttpListener<UserModel>) {
        val params = MainDao.insertInterfaceData(mutableMapOf(), username, password)
        params.put("account", username)
        params.put("password", password)
        Http.get(V_HTTP.URL_USER_LOGIN, params, listener)
    }
}